package com.sservice.model.dao;

import com.sservice.model.entity.ClienteleReconciliation;
import com.sservice.model.vo.AdvanceReceiptVo;
import com.sservice.model.vo.ClienteleReconciliationVo;

import java.util.List;

/**
 * 客户账户总额
 */
public interface ClienteleReconciliationMapper {
    int deleteByPrimaryKey(Long id);

    int insert(ClienteleReconciliation record);

    int insertSelective(ClienteleReconciliation record);

    ClienteleReconciliation selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(ClienteleReconciliation record);

    int updateByPrimaryKey(ClienteleReconciliation record);

    /**
     * 按条件统计
     *
     * @param record
     * @return
     */
    int queryByCount(ClienteleReconciliationVo record);

    /**
     * 分页
     *
     * @param record
     * @return
     */
    List<ClienteleReconciliation> queryByPage(ClienteleReconciliationVo record);

    //查询客户往来对账总表
    List<ClienteleReconciliation> querySale(ClienteleReconciliationVo record);

    /***
     * 数量统计
     * @param record
     * @return
     */
    Integer countSale(ClienteleReconciliationVo record);

    /***
     * 查询单个
     * @param record
     * @return
     */
    ClienteleReconciliation querySaleByUnitCode(ClienteleReconciliationVo record);

    /***
     * 按销售订单
     * @param record
     * @return
     */
    List<AdvanceReceiptVo> querySaleOrder(AdvanceReceiptVo record);

    List<AdvanceReceiptVo> querySaleOrderBeforePage(AdvanceReceiptVo record);

    Integer countSaleOrder(AdvanceReceiptVo record);


    /**
     * 按发货单
     *
     * @param record
     * @return
     */
    List<AdvanceReceiptVo> querySaleBill(AdvanceReceiptVo record);

    List<AdvanceReceiptVo> querySaleBillBeforePage(AdvanceReceiptVo record);

    Integer countSaleBill(AdvanceReceiptVo record);

    //    查询供应商往来对账总表
    List<ClienteleReconciliation> queryProvider(ClienteleReconciliationVo record);

    Integer countProvider(ClienteleReconciliationVo record);

    /***
     * 获取供应商的
     * @param record
     * @return
     */
    ClienteleReconciliation queryProviderByUnitCode(ClienteleReconciliationVo record);

    List<AdvanceReceiptVo> queryProviderOrder(AdvanceReceiptVo record);

    /**
     * 按订单查询当前页之前的应付余额
     *
     * @param record
     * @return
     */
    List<AdvanceReceiptVo> queryProviderOrderBeforePage(AdvanceReceiptVo record);

    /**
     * 按订单查询条件统计
     *
     * @param record
     * @return
     */
    Integer countProviderOrder(AdvanceReceiptVo record);

    List<AdvanceReceiptVo> queryProviderBill(AdvanceReceiptVo record);

    Integer countProviderBill(AdvanceReceiptVo record);

    List<AdvanceReceiptVo> queryProviderBillBeforePage(AdvanceReceiptVo record);
}